home *** CD-ROM | disk | FTP | other *** search
/ Larry Magid's Essential Internet / Larry Magid's Essential Internet (Quarterdeck Corporation)(1995).ISO / qsockpro.qip / LIGHTSID.MPS < prev    next >
Text File  |  1995-10-09  |  2KB  |  58 lines

  1. # Lightside, Inc. PPP and SLIP login script
  2. # Copyright 1995 Quarterdeck Office Systems
  3. # 5-9-95 CEL
  4.  
  5. #define the variables we will need
  6.  
  7. STRING username
  8. STRING password
  9. STRING framing
  10. STRING IPAddress
  11.  
  12. # uncomment for debugging
  13. # TRACE ON
  14.  
  15. # reset maximum login timeout.  
  16. SetTimeout 90
  17.  
  18. CfgGetValue "Username" username
  19. IF result = 0 THEN
  20.     ABORT "ERROR: Cannot load username from Qdeck.ini."
  21. ENDIF
  22.  
  23. CfgGetValue "Password" password
  24. IF result = 0 THEN
  25.     ABORT "ERROR: Cannot load password from Qdeck.ini."
  26. ENDIF
  27.  
  28. # get framing layer (MPPPP, MPSLIP)
  29. # abort with an error if we can't read the Framing setting
  30. CfgGetValue "Framing" framing
  31. IF result = 0 THEN
  32.     ABORT "Can't read 'Framing' setting from qdeck.ini"
  33. ENDIF
  34.  
  35. CommWaitFor "Login:"           # wait for login prompt
  36. IF framing = "MPSLIP" THEN
  37.      CommSend "SLIP"
  38. ENDIF
  39.  
  40. CommSend    username            # send user name
  41. CommSend    "%r"                # send carriage return
  42.  
  43. CommWaitFor "Password:"         # wait for password prompt
  44.     CommSend password           # send password
  45.     CommSend "%r"               # send carriage return
  46.  
  47. # if SLIP, we need to  get the IP address
  48. IF framing = "MPSLIP" THEN
  49.     PRINT "%rGetting IP address for SLIP"
  50.     CommWaitFor ") to"          # wait for string that precedes the reported IP Address
  51.     CommReadIPAddr IPAddress    # IP address should be next word
  52.     # store the IP address
  53.     CfgSetValue "IPAddress" IPaddress
  54. PRINT "%rIP Address set to ["; IPAddress; "]"
  55. ENDIF                           # end of SLIP logic
  56.  
  57. END                          
  58.